/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.snda.dw.lidejia.hadooptotalsort.meta;

import java.util.ArrayList;
import java.util.List;
import org.apache.hadoop.fs.Path;

/**
 *
 * @author lidejia
 */
public class SortKeyMetaPool {

    private static final SortKeyMetaPool instance = new SortKeyMetaPool();

    public static SortKeyMetaPool getInstance() {
        return instance;
    }
    //
    private List<SortKeyMeta> metas = new ArrayList<SortKeyMeta>();

    private SortKeyMetaPool() {
        // read meta from file
        Path path = new Path("_metas");
        List<SortKeyMeta> result = SortKeyMetaIO.readFrom(path);
        this.metas.addAll(result);
    }

    public List<SortKeyMeta> getMetas() {
        return this.metas;
    }
}
